home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / 96000tar.z / 96000tar / 96000 / appb / b133a.asm < prev    next >
Assembly Source File  |  1992-04-28  |  3KB  |  47 lines

  1. ; This program was originally published in the Motorola DSP96002 Users Manual
  2. ; and is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  3. ; Operation, 6501 William Cannon Drive West, Austin, Texas 78735-8598.  For
  4. ; more information, refer to the DSP96002 Users Manual, Appendix B, DSP
  5. ; Benchmarks.
  6. ;
  7. ; B.1.33    Graphics Accept/Reject Of Polygons  
  8. ;In graphics applications, checks are made to determine if objects are  within a viewing window.  Initial 
  9. ;checks are made to see if the object  can be trivially accepted or trivially rejected.  If the object can 
  10. ;not  be trivially accepted/rejected, then a clipping algorithm is used.  
  11. ;The following code segments perform the trivial accept/reject of a  point, line or 4 point polygon with-
  12. ;in a cube.  
  13. ; B.1.33.1    One Point Accept/Reject  
  14. ;This determines if the point (x,y,z) is within a three-dimensional view  cube.  If the point is within the 
  15. ;cube, the A (accept) bit of the CCR  will be set.  Single point accept/reject for plotting is useful for  
  16. ;plotting of stochastic images such as fractals.  
  17. ;Registers: 
  18. ;   d0 = x          d4 = limit 
  19. ;   d1 = y          d5 = unused 
  20. ;   d2 = z          d6 = unused 
  21. ;   d3 = unused     d7 = unused 
  22. ;
  23. ;Memory Map: 
  24. ;               X Memory    Y Memory 
  25. ;                             Xmin   ? r0 
  26. ;                             Xmax 
  27. ;                             Ymin 
  28. ;                             Ymax 
  29. ;                             Zmin 
  30. ;                             Zmax 
  31. ;                    Single Point Accept/Reject 
  32. ;                                                          Program    ICycles 
  33. ;                                                            Words 
  34.   ori    #$80,ccr                        ;set accept bit      1     1 
  35.   move                   y:(r0)+,d4.s    ;get window minimum  1     1 
  36.   fcmp   d4,d0           y:(r0)+,d4.s    ;x-Xmin              1     1 
  37.   fcmp   d0,d4           y:(r0)+,d4.s    ;Xmax-x              1     1 
  38.   fcmp   d4,d1           y:(r0)+,d4,s    ;y-Ymin              1     1 
  39.   fcmp   d1,d4           y:(r0)+,d4.s    ;Ymax-y              1     1 
  40.   fcmp   d4,d2           y:(r0)+,d4.s    ;z-Zmin              1     1 
  41.   fcmp   d2,d4                           ;Zmax-z              1     1 
  42. ;                                                             ---   --- 
  43.                                                                                                   Totals:    8    8 
  44.  
  45. ;If the point is within the limits, then the A bit of the CCR is  equal to one, otherwise, the point can 
  46. ;be rejected.  
  47.